package adv1;

import java.util.*;

public class SetTest {

	public static void main(String[] args) {
		Set s = new HashSet();
		s.add("小狗");
		s.add("猫");
		s.add(4.78);
		s.add(260);
		for (int i = 1; i <= 10; i++) {
			s.add(new News("熊" + i + "打了熊" + (i + 1), "可爱", "今年春天", "东北"));
		}

		s.add(new News("达兴被蚊子咬了", "达兴被蚊子咬了", "今天下午", "204"));
		System.out.println(s.size());
		System.out.println(s);
		System.out.println(">>>>>>>>>>>>>>>>>>>>>.");
		s.add("小狗");
		System.out.println(s.size());
		System.out.println(s);
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>.");
		News n = new News("达兴被蚊子咬了", "达兴被蚊子咬了", "今天下午", "204");
		s.add(n);// Object.hashCode
		System.out.println(s.size());
		System.out.println(s.contains(n));
		System.out.println(">>>>>>>>>>>>遍历-----");
		for (Object o : s)
			System.out.println(o);
		// toArray
		// Iterator
	}

}
